package acm;

import java.util.Scanner;

public class 大小写互转 {
    public static void main(String[] args){
        Scanner in = new Scanner(System.in);
        char[] word = in.next().toCharArray();
        for (int i=0;i<word.length;i++){
            if (word[i]>='a'&word[i]<='z'){
                word[i]=(char)(word[i]-32);
            }
            else  if(word[i]>='A'&word[i]<='Z'){
                word[i]=(char)(word[i]+32);
            }
            System.out.print(word[i]);
        }

    }
}
